﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Runtime.Serialization;
using System.ComponentModel;
using System.IO;

namespace ajayumi.develop.win32.Transport.WCF.Services.DataContracts
{
    /// <summary>
    /// 传输文件实体类的基类
    /// Author  : 黄乙冬
    /// Date    : 2011-08-28
    /// </summary>
    [DataContract]
    public abstract class TransFileBaseInfo
    {
        /// <summary>
        /// 文件或文件夹名称
        /// </summary>
        [DataMember]
        public string Name
        {
            get;
            set;
        }

        private string rootDir = string.Empty;
        /// <summary>
        /// 根目录
        /// </summary>
        [DataMember]
        public string RootDir
        {
            get { return this.rootDir; }
            set { this.rootDir = value; }
        }

        private string relativePath = string.Empty;
        /// <summary>
        /// 文件相对路径
        /// </summary>
        [DataMember]
        public string RelativePath
        {
            get { return this.relativePath; }
            set { this.relativePath = value; }
        }

        /// <summary>
        /// 完整路径
        /// </summary>
        public string FullPath
        {
            get { return Path.Combine(this.rootDir, this.relativePath); }
        }

        /// <summary>
        /// 文件长度，单位：字节
        /// </summary>
        [DataMember]
        public long Length
        {
            get;
            set;
        }

        /// <summary>
        /// 创建时间
        /// </summary>
        [DataMember]
        public DateTime CreationTime
        {
            get;
            set;
        }

        /// <summary>
        /// 最后修改时间
        /// </summary>
        [DataMember]
        public DateTime LastAccessTime
        {
            get;
            set;
        }

        /// <summary>
        /// 地址
        /// </summary>
        [DataMember]
        public string IP { get; set; }
    }
}
